﻿/*
 * Copyright © 2020, Wuxi Safover Intelligent Technology Co., Ltd. All rights reserved.
 * 
 * 无锡安永智能科技有限公司版权所有，未经许可，不得用于商业用途
 * 
 * Visit: https://www.safover.com/ 
 */

using System;
using Safover.Lidar.DataContract;

namespace Safover.LidarCollector.Managers
{
    public delegate void SingleCollectionWorkingStatusChangedEventHandler(SingleCollectionWorkingStatusChangedEventArgs e);

    /// <summary>
    /// 全局采集工作状态改变事件代理
    /// </summary>
    /// <param name="e"></param>
    public delegate void GlobalCollectionWorkingStatusChangedEventHandler(GlobalCollectionWorkingStatusChangedEventArgs e);

    /// <summary>
    /// 周期性采集工作状态改变事件代理
    /// </summary>
    /// <param name="e"></param>
    public delegate void PeriodicCollectionWorkingStatusChangedEventHandler(PeriodicCollectionWorkingStatusChangedEventArgs e);


    public delegate void MultiStepScanStatusChangedEventHandler(MultiStepScanStatusChangedEvent e);


    public class SingleCollectionWorkingStatusChangedEventArgs : EventArgs
    {
        /// <summary>
        /// 单次采集是否正在进行（即非等待状态指示）
        /// </summary>
        public bool IsSingleCollecting { get; internal set; }

        public LidarWorkMode SingleLidarWorkMode { get; internal set; }

        public float PercentageCompletion { get; internal set; }

        /// <summary>
        /// 定点采集模式下，距离下次单次采集的时间间隔（s）
        /// </summary>
        public int CountDownSecondsForNextFixedCollection { get; internal set; }

        /// <summary>
        /// 剖面或切面采集模式下，距离下次大循环采集的时间间隔（s）
        /// </summary>
        public int CountDownSecondsForNextPeriodicCollection { get; internal set; }

        public TimeSpan Elapsed { get; internal set; }

        public string Message { get; internal set; }

        public override string ToString()
        {
            return $"Is collecting = [{IsSingleCollecting}]; Percentage compltion = [{PercentageCompletion}]; Seconds elapsed = [{Elapsed.TotalSeconds}]; ";
        }
    }

}
